##
#  CMake script for the rail launch tutorial program:
##
cmake_minimum_required(VERSION 2.8)
project(Fuxi)
set(FUXI_DIR ${CMAKE_CURRENT_SOURCE_DIR})
#set(CMAKE_INSTALL_PREFIX ${FUXI_DIR})
option(USE_COTIRE "Is use cotire for precompilation." ON)

list(APPEND CMAKE_MODULE_PATH ${FUXI_DIR}/cmake/modules/)

# Load all macros:
file(GLOB _macro_files cmake/macros/*.cmake)
FOREACH(_file ${_macro_files})
  message(STATUS "Include ${_file}")
  include(${_file})
ENDFOREACH()

VERBOSE_INCLUDE("cmake/cotire.cmake")
VERBOSE_INCLUDE("cmake/setup.cmake")

#
# Feature configuration:
#
file(GLOB _configure_files "cmake/configure/configure_*.cmake")
list(SORT _configure_files) # make sure to include in alphabetical order
FOREACH(_file ${_configure_files})
  VERBOSE_INCLUDE(${_file})
ENDFOREACH()

set(BOOST_INCLUDEDIR /usr/include) #Set this first, then boost can be found
set(BOOST_LIBRARYDIR /usr/lib/x86_64-linux-gnu)
set(Boost_USE_STATIC_LIBS OFF)

find_package(Boost 1.58 COMPONENTS iostreams serialization system thread log python REQUIRED)
find_package(PythonLibs REQUIRED)

set(FUXI_THIRD_LIBRARIES ${Boost_LIBRARIES} ${PYTHON_LIBRARIES})
set(FUXI_INCLUDEDIR "${FUXI_DIR}/include")
include_directories(${FUXI_INCLUDEDIR} ${BOOST_INCLUDEDIR} ${DEAL_II_INCLUDE_DIRS} ${PYTHON_INCLUDE_DIRS})

ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(doc)

SET(CPACK_GENERATOR "DEB")
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER "Zhipeng Lin") #required
include(CPack)



